package com.system.service;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import com.system.dao.IOrganizeDao;
import com.system.dao.OrganizeDaoImpl;
import com.system.entity.OrganizeInfo;

public class OrganizeServiceImpl implements IOrganizeService {
	IOrganizeDao organizeDao = new OrganizeDaoImpl();
	public String addOrganizeInfo(OrganizeInfo organizeInfo) {
		try {
			return organizeDao.addOrganizeInfo(organizeInfo);
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return "0";
	}
	public String deleteOrganizeInfo(String infoNum) {
		try {
			return organizeDao.deleteOrganizeInfo(infoNum);
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return "0";
	}
	public String changeOrganizeInfo(OrganizeInfo organizeInfo, String oldID) {
		try {
			return organizeDao.changeOrganizeInfo(organizeInfo, oldID);
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return "0";
	}
	public List<OrganizeInfo> organizeInfoList(String keyword) {
		List<OrganizeInfo> list = new ArrayList<OrganizeInfo>();
		try {
			list = organizeDao.organizeInfoList(keyword);
			return list;
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return null;
	}

}
